Learn what design decisions affect the speed and overall performance of your application.rough some ToolBook basics and helps you make decisions about how to start your developement effort. You'll find information on ToolBook's internal structure, content development, code design, and how to target your application to reach your intended audience...pplication to reach your intended audience........
enterpage
1440,8640
1728,-13984
@!T!Q*
@!T!Q*
9505241631422885366100357012
ASYM_TpID
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
585,90
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
520,55
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
800,140
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
T&f&{
915,105
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
EnterPage
UpdateDisplay
Table of Contents
destination
background
enter destination
destination
Hotword
buttonClick
buttonClick
destination
>= ""
("enter
1440,18690
Postit4
1728,22448
Postit3
1640,22360
Postit1
Postit2
Table of Contents
title
Section List
System Books
Fonts
Image Buffers
Imaging Basicsssssssssssssssssss
s in ToolBook
destination
background
destination
destination
destination
Section List
Design / Book
Section List
SMARTDRIVE
Conventional Memory
CONFIG.SYS
AUTOEXEC.BAT
WIN.INI
SYSTEM.INI
destination
destination
Section List
System / Configuration
Section List
Store Image
Storing the Background
Storing the Page
Graphics
Metafiles
Complex Objects vs Bitmaps
Bitmap Color Depth
Objects
DrawDirect
Angled vs Curved
Opaque vs Transparent Fields
Layering
DrawDirect Text
Flipping Pages
background
destination
destination
destination
background
destination
destination
destination
destination
background
destination
destination
destination
destination
destination
destination
destination
Section List
Design / Background & Page
Section List
Enter & Leave
Generic Scripts
System Booksripts
s vs Object Scripts
destination
destination
destination
Section List
OpenScript / Handlers
Section List
Execute ( )
SysHistoryRecordddddddddddddddddddddddddd
destination
destination
Section List
OpenScript / Commands
Section List
User InterFace Conventions
Page Tips
destination
destination
Section List
Design Tips
Section List
hotword
User Properties and Variables
buttonClick
buttonClick
/"User Properties
Variables"
User Properties
Variables
destination
destination
Section List
OpenScript / Properties & Variableses
1540,22260
ASYM_BeenHere
1728,22304
System Books
Book Design: System Books
title
5300,787
Postit4
1440,9240
Postit2
2550,2543
Postit3
Postit1
The book script of the system book is part of the object hierarchy for the current book. If a message is not handled in the current book, ToolBook searches for a corresponding handler in the book script of the system book(s). Only the book script of the system book becomes part of the object hierarchy, although handlers in the system book script can redirect messages to other objects and pages in the system book.
ToolBook opens system books only when looking for a handler, so the number of system books that you specify does not necessarily affect ToolBook performance. However, performance can slow if ToolBook has to open and search the book scripts of many system books to find a handler. To keep your scripts running as quickly as possible, specify only the system books that you really need and make sure they contain only necessary handlers. Put the most heavily used system books at the front of the sysBooks stack.
To minimize the number of handlers in the hierarchy, keep only essential handlers in the book script of the system book. If you have handlers for user-defined functions or for messages that are unique to that system book, put them into page scripts of the system book, then forward the messages to those pages.
There are many things to keep in mind when writing system books and, writing your own handlers. For details, read Chapter 7 "Common scripting techniques" in the OpenScript Reference Manual.l.r Manual..ook User Manual...nual.n mind when writing system books and, writing your own handlers. For more information, read the chapter called "Common Scripting Techniques" in the ToolBook User Manual..
System Books
415,717
ASYM_BeenHere
2550,2687
Book Design
7.7Q*
title
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
updateDisplay
enterPage
950925095059247312184229106377
ASYM_TpID
Bitmap vs Vector
testField
testType
Modern
fontName
enterPage
testField
fontName
clearTest
"testType"
"testField"
"Modern"
"fontName"
clearTest
Fonts: Bitmap vs Vector
title
Postit4
ASYM_BeenHere
Postit2
1440,9540
Postit3
2550,2831
Postit1
Bitmap fonts such as MS Sans Serif or MS Serif, display much more quickly than vector fonts such as Modern or Roman.
This test writes text, character by character, using the font type specified in the Test Type option box.
You can determine the font type by looking under the Fonts icon in the Control Panel. Vector fonts are followed by (plotter) and bitmap fonts are followed by (VGA res).owed by (VGA res).A res).
The imageBuffers property of a viewer has three possible settings, 0, 1 and 2.
A setting of 0 means that ToolBook doesn't create any image buffers for a viewer. This results in the most 'flashy' of the three options, but it also uses the least amount of memory. It is typically fast in situations where there is one page per background. This setting also over-rides the drawDirect property of any object on the page or background, and forces them to behave as if they had the drawDirect property set to TRUE.
Setting this property to 1 means that ToolBook creates one image buffer for the viewer, and that buffer is used for the background. This can be a good setting if your application has a number of pages per any given background.
If this property is set to 2, ToolBook creates an image buffer for the page and the background. This can result in slow page display, requires the most amount of memory, and results in the smoothest display. This setting is good if you have animated ToolBook objects, and you don't want a lot of 'flashing' to occur.
0 Image Buffers -
Objects are drawn directly to your viewer. Is usually the quickest to display.
1 Image Buffer -
A buffer is created for the background of your viewer.
2 Image Buffers -
A buffer is created for the background and page of your viewer. Is usually the slowest to display.
Imaging Basics
1440,8190
Postit1
2990,8009
Postit3
2575,8464
Postit2
Postit4
Imaging Basics
title
ToolBook spends much of its time displaying pages or updating objects on the screen.
Understanding how ToolBook displays a page can help you choose designs that are more efficient, and take less time to display, resulting in faster books..
Other Stuff
Displaying
Pages
2850,9525
ASYM_BeenHere
2850,9669
Imaging Basics
:":Q*
:":Q*
9505241633553018133158298175
ASYM_TpID
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
975,90
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
@!R!{
1090,55
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
680,35
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
1305,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
Basics
2550,1391
Postit1
1440,7890
Postit2
Postit4
415,-435
Postit3
Imaging Basics: Overview
title
You can think of the way ToolBook displays a page as combining three transparencies: the background on the bottom, the page, and other objects such as graphics, fields, and buttons (direct images).
ToolBook composes the background and page images offscreen in memory then transfers them to the screen. ToolBook composes the direct image, object by object, directly onscreen...... the screen.
Background
3744,1368
4275,900
newHome
Previous
Name:
Phone:
Events:
Sports Event Corp.
,"JdY
,"JdY
direct
background
s_speed
Image Names
foreground
?newHome
nameField
images
bSize
moveImage
buttonClick
buttonClick
4s_speed
nameField
"Image Names"
images
"direct"
bSize
+ 100,
++ 100
" + "
moveImage
, newHome
Demonstrate
Foreground
3744,1368
4275,900
newHome
Image Names
Background + Foreground + Direct=
Direct
4275,900
newHome
Cathy Smith
204-555-6565/
2550,1535
ASYM_BeenHere
5300,-365
Direct Layer
2550,3695
Postit1
1440,7890
Postit3
2550,3551
Postit2
415,1725
Postit4
Direct Image
title
ASYM_BeenHere
The direct image displays faster than the other images and shows all objects, backgrounds and pages, whose drawDirect property is true. Page objects are shown in front of background objects.
When you create any new object, the default is to make it part of the direct image. To find out whether an object is drawn directly or not, select it.. The
Draw Direct Ctrl+Z
Transparent Ctrl+E
Align
Reshape
Flip Horizontal
Flip Vertical
Rotate Left
Rotate Right
Draw Centered
Draw Direct
3744,1329
Cathy Smith
204-555-6565?
Image Names
Direct
The Draw Direct menu item is checked and its selection handles are hollow. These indicate that the drawDirect property is true..
5300,1795
2550,7295
Postit1
1440,9390
Postit3
2550,7151
Postit2
415,5325
Postit4
Page Image
title
The page image shows all page objects whose drawDirect property is false. Objects on this image display more smoothly but slower than objects on the direct image.
To make an object part of the page image, select the object and then uncheck Draw Direct in the Draw menu. When you select an object where the drawDirect property is false, the selection handles are solid.
The default for drawDirect is defined in the MTB40.INI or TB40.INI file by the startupDrawDirect line in the [ToolBook] section......
Draw Direct Ctrl+Z
Transparent Ctrl+E
Align
Reshape
Flip Horizontal
Flip Vertical
Rotate Left
Rotate Right
Draw Centered9
Foreground
3744,1329
Image Names
Pageground5
The Draw Direct menu item is not checked and selection handles are solid. These indicate that the drawDirect property is false.
5300,5395
Background Image
title
1440,11040
Postit1
5300,6259
Postit3
415,6189
Postit2
2550,8159
Postit4
The background image has a pattern and shows background objects whose drawDirect property is false.
As with the page image, objects in the background image display more smoothly but slower than ones in the direct image. You can make a background object part of this image by selecting the object and unchecking Draw Direct in the Draw menu..raw menu..nu.tem in the Draw menu. menu.
Draw Direct Ctrl+Z
Transparent Ctrl+E
Align
Reshape
Flip Horizontal
Flip Vertical
Rotate Left
Rotate Right
Draw Centered
Background
3744,1329
Previous
Name:
Phone:
Events:
Sports Event Corp.C
Image Names
Background
The Draw Direct menu item is not checked and selection handles are filled.
2550,7007
Postit1
1440,9690
Postit3
2550,6863
Postit2
415,5037
Postit4
Displaying Pages
title
When you turn to a new page, ToolBook displays the page using the following procedure:
Draw the background in memory.
Draw the page in memory.
Combine the two images on the screen.
Add the direct image to the screen, object by object.....
Draw Direct
moved
moved
o@home
6504,3423
Cathy Smith
204-555-6565
Screen
3894,753
Background
moved
moved
o@home
6684,753
Previous
Name:
Phone:
Events:
Sports Event Corp.)
Foreground
moved
moved
o@home
6669,3348
Demonstrate
Attention
Memory Label
Memoryy
Screen
5300,5107
Storing Images
5300,3955
Postit4
1440,8040
Postit2
2550,5711
Postit3
2550,5855
Postit1
Storing Images: Store Image
title
ToolBook can store the page's completed image. Then when the page is displayed, the stored image is used directly rather than redrawing it, which is often faster.
You can store the background image or the combined background/page image. The direct image is not stored.
The stored image is compressed and saved with the book.
01101100110100011101010011110101
Screen
3654,2238
Background
moved
moved
o@home
4584,1878
Previous
Name:
Phone:O
Events:
Sports Event Corp.
Foreground
moved
moved
o@home
4779,1803
Stored page-background image image
415,3885
Store Image
s_lastTestTime
enterPage
4s_lastTestTime
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
Storing the Background
415,3021
Postit4
5300,3091
Postit2
1440,7290
Postit3
2550,4847
Postit1
Storing the Background
title
To store the background image, choose the Store Image option in the Background Properties dialog box.
The image is stored when you turn pages, switch to Reader level, or close the book. As ToolBook stores the image, it displays an information box showing the percentage completed. Unchecking the Store Image option removes the stored image.e.
Choosing this option will save this background's image...
2550,4991
Stored Background
Stored Image
enterPage
"Stored Image"
5300,4963
Postit4
1440,7140
Postit2
2550,6719
Postit3
2550,6863
Postit1
Stored Background
title
When a page's background image is stored, ToolBook displays the page using the following procedure...
Retrieve the stored background.
Draw the page in memory.
Combine the images on screen.
Add the direct image to the screen, object by object.....ct.bject.
Screen
3654,2238
Background
moved
moved
o@home
6699,558
Previous
Name:
Phone:
Events:
Sports Event Corp.+
Foreground
moved
moved
o@home
6684,3093
Draw Direct
Cathy Smith
204-555-6565
Demonstrate
Stored Image
10010101101010010110101001101100
Stored background
image]
Attention
Memory Label
Memory
Screen
415,4893
Storing the Page
5300,6115
Postit4
1440,7590
Postit2
2550,7871
Postit3
2550,8015
Postit1
Storing the Page
title
To store the combined background/page image of a page, check Store Image in the Page Properties dialog box.
As when storing the background image, ToolBook stores the combined image when you turn pages, switch to Reader level, or close the book. Unchecking the Store Image option removes the stored image.
Choosing this option will save this page's combined page/background image.image.
415,6045
Stored Page
Stored Image
enterPage
"Stored Image"
5300,4099
Postit4
1440,6990
Postit2
2550,5855
Postit3
2550,5999
Postit1
Stored Page
title
When a page's combined background/page image is stored, ToolBook displays the page very quickly using the following procedure.
Retrieve the stored image and display it on the screen.
Add the direct image to the screen, object by object.ct....bject.
Screeng
Screen
3654,2238
Background
moved
moved
o@home
3939,513
Previous
Name:
Phone:
Events:
Sports Event Corp.9
Foreground
moved
moved
o@home
3939,513
Draw Direct
Cathy Smith
204-555-6565
Stored Image
10010101101010010110101001101100
Stored background/ page imageimage-
Demonstrate
Attention
415,4029
Implications
Storing Images: Implications
title
415,5181
Postit4
5300,5251
Postit2
1440,6240
Postit3
2550,7007
Postit1
By storing an image, your book will display the stored pages more quickly, but will also cause your book to take up more disk space.
Each stored image is valid only on the display device active when you stored the image. You can store images for multiple devices by running ToolBook and saving images on each different device. A combo box in the Page Properties and Background Properties dialog boxes shows the images stored.
ges stored.
Title
Stored images are fast, but take more space in your book.
Title
Each stored image works for one display device only.C
2550,7151
Metafiles
s_lastTestTime
s_testTime
testType
enterPage
s_lastTestTime
s_testTime
clearTest
leavePage
Metafile
Bitmap
clearTest
4s_testTime, s_lastTestTime
"testType"
clearTest
4s_testObj
"Metafile"
@home
"Bitmap"
Graphics: Metafiles
title
2550,-193
Postit4
415,-2163
Postit2
5300,-2093
Postit3
1440,6240
Postit1
Just as draw objects may display more quickly as bitmaps, imported metafiles can be converted to bitmaps to display faster. To do this, click the Convert button in the Picture Properties dialog box.
Note: The resulting bitmap cannot be converted back to metafile format.
This example compares moving a metafile with its equivalent bitmap, depending on the selection in the Test Type option box.
Converting a metafile to a bitmap may make it display faster.
testType
buttonDown
s_testType
buttonUp
4s_testType
Metafile
Bitmap
Test Type
Metafile
Bitmap
showElapsedTime
s_testType
startTime
buttonClick
buttonClick
4s_testType, s_testObj
"Metafile"
"Bitmap"
-- Run
startTime
yStart
4000
H0,60
showElapsedTime
@home
limits
MetafileA
Bitmap
Metafile
6180,1280
Bitmap
7815,1260
Spiro
Graphics
Bitmap Color Depth
clearTest
enterBackground
Bitmap Color Depth
clearTest
leaveBackground
Bitmap Color Depth
Metafiles
showElapsedTime
Complex Objects vs Bitmaps
firstIdle
clearTest
"Bitmap Color Depth"
firstIdle
<> "Metafiles" \
<> "Complex Objects vs Bitmaps"
showElapsedTime
flushMessageQueue()
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
F$X${
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
9509250951162473298296870952
ASYM_TpID
"""""
Complex Objects vs Bitmaps
clearTest
leavePage
Bitmap
Drawn
clearTest
clearTest
"Flag"
'"Bitmap"
@home
"Drawn"
Complex Objects vs Bitmaps
title
2550,-193
Postit4
415,-2163
Postit2
5300,-2093
Postit3
1440,6240
Postit1
The purple dinosaur is a group made up of more than 35 draw objects. The green dinosaur is a bitmap created using Shift+Print Screen and Windows Paintbrush. Bitmaps are especially useful for small objects that may be made of many draw objects.
This example works by alternately moving each object as many steps as possible in one-half second until one of them wins.
Complex, small draw objects may display faster if they are converted to bitmaps.
Track
Bitmap
5(GetTickCount
currObj
Track
Drawn
clearTest
buttonClick
buttonClick
clearTest
finish
"Track" - 150
i = 0
currObj
'"Bitmap"
"Drawn"
GetTickCount()
+ 500
H60,0
1 - i
H-100,0
H100,0
Start Race
Drawn
3940,1350
Bitmap
Draw Objects
Bitmap
3915,2595
" p w
" pwp"
" pww
p"" "
wwp""
p"" "" wwp
wwp""
wwp""
wp""
wp"" ww
"" ww
p " " wp"
"" "
" p"
"" wp
wp ""
"" wwp ""
wwp " " w
Bitmap Color Depth
testType
enterPage
s_lastTestTime
s_testTime
clearTest
"testType"
clearTest
4s_testTime, s_lastTestTime
Bitmap Color Depth
title
2550,3695
Postit4
415,1725
Postit2
5300,1795
Postit3
1440,10290
Postit1
ASYM_BeenHere
Each graphic is saved at a particular color depth, commonly referred to as bits per pixel (bpp), which specifies the maximum number of colors that can be saved in the current format. The most common depths are 4, 8, 16, and 24 bpp.
The following table maps bits per pixels to number of colors.
bpp # of Colors
=== =========
2 2
4 16
8 256
15 32K
16 64K
24 16M
ToolBook automatically reduces the number of colors in a graphic so that it can be viewed by the current video driver. ToolBook displays Images that are saved in a format that allows more colors than can be displayed by the current video driver more slowly. Therefore use images with as few colors as possible, and save them in the lowest possible bpp format.
This example demonstrates the effect of bitmap graphics on page turning. Choose the appropriate number of colors for the graphic and click the Test buttonbutton
testType
buttonDown
s_testType
buttonUp
4s_testType
16 Colors
256 Colors
16M Colors
Test Type
16MCols
16M Colors
s_testType
startTime
256Cols
256 Colors
16Cols
16 Colors
pName
buttonClick
buttonClick
4s_testType, s_testObj
"16 Colors"
pName = "16Cols"
"256
"16M
9MCols"
-- Run
startTime
Images with only 16 colors display faster when running a 256-color display driver.
Objects in the direct image display fastest; objects in the background image display slowest. This is especially true of animation.
This example animates a rectangle drawn on the background, page, or draw direct image, depending on the selection in the Test Type option box.
Objects on the direct image display faster than objects on the background image.
Test Type
testType
buttonDown
s_testType
buttonUp
4s_testType
Background
Draw Direct
s_testObj
Background
Draw Direct
showElapsedTime
s_testType
startTime
clearTest
Foreground
buttonClick
buttonClick
4s_testType, s_testObj
-- Set up
clearTest
"Background"
sysDrawDirect
"Foreground"
xStart
yStart
xInc
yInc
sysTransparent
-- Run
startTime
showElapsedTime
5300,67
ASYM_BeenHere
2550,1967
Objects
s_lastTestTime
s_testTime
enterPage
4s_testTime, s_lastTestTime
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
b+t+{
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
950925095119247332333119212874
ASYM_TpID
Angled vs Curved
testType
enterPage
clearTest
leavePage
s_testObj
clearTest
"testType"
clearTest
4s_testObj
Angled vs Curved
title
1440,7590
Postit4
2550,1103
Postit2
2550,1103
Postit3
415,-867
Postit1
Straight lines display more quickly than curved ones. Objects with curves such as rounded rectangles, ellipses, curves, or arcs display more slowly than straight lines, rectangles, and angled lines.
This example draws a set of 64 rectangles with either rounded or angled corners depending on the selection in the Test Type option box.
Angled objects with straight sides will draw more quickly than rounded objects using curves.
Test Type
testType
buttonDown
s_testType
buttonUp
4s_testType
Rounded
Angled
yStart
s_testObj
Rounded
xStart
showElapsedTime
s_testType
startTime
clearTest
buttonClick
buttonClick
4s_testType, s_testObj
-- Set up
clearTest
xStart
yStart
xInc
yInc
width
height
sysDrawDirect
sysTransparent
-- Run
startTime
"Rounded"
showElapsedTime
5300,-797
Opaque vs Transparent Fields
testField
testType
enterPage
"testType"
"testField"
Opaque vs Transparent Fields
title
5300,-365
Postit4
1440,8040
Postit2
2550,1391
Postit3
2550,1535
Postit1
Text in a transparent field displays more slowly than text in an opaque one particularly if objects are visible through the transparent field.
This example writes text, character by character, into a transparent or opaque field, depending on your selection in the Test Type option box.ion box.box.
Opaque fields display faster than transparent fields.
ToolBook displays a record field faster if it is not obstructed by any object on the background image.
If any record field is obstructed, ToolBook uses a slower method to display all record fields in the background (even ones that are unobstructed).ed).
Overlapping objects on the background image in front of any record field will cause all record fields to be drawn more slowly.
testType
buttonDown
s_testType
buttonUp
4s_testType
Obstructed
Unobstructed
Test Type
limits
5300,499
2550,2399
Obstructed Fields and Scrolling
testType
enterPage
clearTest
Obstructor
leavePage
testField
clearTest
"testType"
clearTest
"Obstructor"
"testField"
Layering 2
title
2550,2831
Postit4
415,861
Postit2
5300,931
Postit3
1440,9390
Postit1
ToolBook scrolls fields faster when they are not obstructed by other objects. The speed improvement is considerable. However, unlike record fields, if one field is obstructed, it doesn't affect the scrolling speed of other fields.
This example scrolls a field that is either obstructed or unobstructed, depending on your selection in the Test Type option box.
Any overlapping objects in front of a field will cause the field to scroll more slowly.
testType
buttonDown
s_testType
buttonUp
4s_testType
Obstructed
Unobstructed
Test Type
testField
showElapsedTime
s_testType
startTime
Obstructed
clearTest
Obstructor
buttonClick
buttonClick
4s_testType, s_testObj
-- Set up
clearTest
"Obstructor"
"Obstructed"
-- Run
"testField"
startTime
showElapsedTime
testField
Obstructor
2550,2831
DrawDirect Text
testType
enterPage
testField
clearTest
"testType"
clearTest
"testField"
DrawDirect Text
title
5300,931
Postit4
415,429
Postit2
2550,2687
Postit3
2550,2831
Postit1
Setting the drawTextDirect property of a field or record field to true places the text on the direct image. If the drawDirect property of the field is set to false, the borders and scroll bars will be drawn on one of the offscreen images, but the text will still be on the direct image.
This example scrolls a field whose drawTextDirect property is true or false, depending on your selection in the Test Type option box.
A field or record field whose drawTextDirect property is true will display and scroll faster than one whose property is false.
testType
buttonDown
s_testType
buttonUp
4s_testType
False
Test Type
testField
showElapsedTime
s_testType
startTime
clearTest
buttonClick
buttonClick
4s_testType, s_testObj
-- Set up
clearTest
"testField"
c"True"
drawTextDirect
-- Run
startTime
showElapsedTime
testField
415,861
1440,9390
Flipping Pages
5300,643
Postit1
415,573
Postit3
415,429
Postit2
2550,2399
Postit4
Flipping Pages
title
As ToolBook navigates to a page it loads the image of that page into memory. As it fills the allocated memory it purges pages in memory on a first-in/first-out (FIFO) basis.
You can use the flip command to preload pages into memory, which makes navigation appear to be quicker. This can be done while the current page is holding the user's attention.ication is different there is no set number
Flipping Pages
The Test button will lock the screen so that you appear to stay on this page while ToolBook navigates to each page starting at 1 until it gets back to this page.
Each time you click the Test button it will tell you the time it took to go through all the pages and the percentage difference compared to the last time you did the test.
.'+ +F
,&H.&
.'+ +F
showElapsedTime
startTime
buttonClick
buttonClick
startTime
sysSuspendMessages = TRUE
have skipNavigation.
-- The following includes the 3
that
2lip
_honors
W property.
showElapsedTime
1440,9090
2550,2543
User Interface Conventions
testType
enterPage
clearTest
leavePage
Gauge
esetGauge
clearTest
"testType"
clearTest
4s_testObj
"Gauge"
setGauge 0
Tips: User Interface Conventions
title
415,429
Postit4
415,141
Postit2
1440,8940
Postit3
2550,2399
Postit1
In addition to designing your book to work faster, you can make it appear faster by designing the user interface to keep the user informed of progress.
This example shows two OpenScript techniques for informing readers. Depending on your selection in the Test Type option box, either an animated gauge or the hourglass cursor is displayed during a several-second pause.
Books will appear faster if you provide feedback as computation progresses.
testType
buttonDown
s_testType
buttonUp
4s_testType
Gauge
Hourglass
Test Type
.&+ +E
.&+ +E
startTime
Gauge
currentTime
5(GetTickCount
Hourglass
s_testType
esetGauge
clearTest
buttonClick
buttonClick
4s_testType, s_testObj
clearTest
"Hourglass"
"Gauge"
-- Run
startTime
GetTickCount()
currentTime
0< 4000
setGauge (
V) / 4000
Gauge
Indicator
limiter
setGauge
setGauge percent
<= 1
>= 0
"limiter"
yMin
yMax
"Indicator"
Indicator
Limiter
Percent Complete?
2550,2399
5300,499
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
Page Tips
Page Tips
title
1440,7890
Postit4
2550,1247
Postit2
2550,1391
Postit3
415,-579
Postit1
As the Basic Concepts chapter described, storing images can make a page display faster.
When displaying a page with the same background as the current page, ToolBook doesn't have to redraw the background, so the new page is displayed faster.
Finally, page size can make a difference in page turning speed.fference in page turning speed.speed.
For complex pages, storing the background or combined background-page image may make the page display faster.aster.
Turning to a page with the same background is faster than turning to a page with a different background.;
If your book has many backgrounds or has many changes from page to page, a small page size will make the book faster than a large page size.
5300,-509
SmartDrive
clearTest
enterPage
memory
screen
clearTest
clearTest
"screen"
"memory"
System Configuration: SmartDrive
title
2550,383
Postit4
415,-1587
Postit2
5300,-1517
Postit3
1440,6840
Postit1
You can improve your books performance by adding SMARTDRV.EXE to your AUTOEXEC.BAT. SMARTDRV.EXE uses some of the computers, RAM to store information from the hard drive that may be needed in the near future. It does this by reading what the program asks for, then reading the next piece of information into RAM as well. This way, if the program needs the next piece of information it is already in memory and is accessed much faster.
Often, this addition alone significantly boosts performance. To load SMARTDRV.EXE at startup type c:\dos\smartdrv.exe /x on a line by itself in the AUTOEXEC.BAT file.
For more information about SmartDrive & its parameters refer to DOS help. (At the DOS prompt type c:\dos\help smartdrv and then hit Enter)
c:\dos\help smartdrv\dos\help smartdrvEnter)
c:\dos\help smartdrv
screen
memory
Screen
Memoryu
showme
,%H.%
,%H.%
,%H.%
final
scrmem
scrline
qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
clearTest
memory
abcdefghijklmnop
screen
buttonClick
buttonClick
4s_testType, s_testObj
-- Set up
clearTest
-- Run
"abcdefghijklmnop"& ""
"screen"
"scrline" =
"qrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" & ""
"memory"
"scrmem" =
"final" =
Show Me
scrline
scrmem
final
SmartDrive will improve overall system performance.
System Configuration
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
Conventional Memory
reset
enterPage
buttonClick
B"reset"
Conventional Memory
title
2550,95
Postit4
415,-1875
Postit2
5300,-1805
Postit3
1440,6540
Postit1
One of the ways to optimize your computer configuration is to free conventional memory for applications that need to use it.
The upper memory blocks are set aside for your system's use, such as video and hardware drivers. But after these drivers are loaded, there are usually unused upper memory blocks that can be used by other memory resident programs, such as CD-ROM and MOUSE drivers, DOSKEY, SMARTDRIVE, etc.
For details about optimizing your memory and modifying your CONFIG.SYS and AUTOEXEC.BAT files, check your DOS manual under one of the following sections:
"Optimizing Your System"
"Customizing Your System"
"Making More Memory Available"
or check the following commands in your DOS manual:
"LoadHigh" or "LH"
"DeviceHigh"
"MEM""MEM"EM"EM"
Colored areas are different drivers & memory resident programs
MS-DOS
White areas are free segments of memory
Black areas are segments of memory that are used and cannot be moved.
driverLine
ConMem
Driver1
6720,4876,4395,4876,4395,2941,6720,2941
ObjPath
driver2
6720,4725,4395,4725,4395,2788,6720,2788
ObjPath
driver3
6720,4404,4395,4404,4395,1944,6720,1944
ObjPath
,%H.%
,%H.%
ConMem
6ObjPath
endPos
startPos
driverLine
rectangle Driver
ObjName
moveImage
buttonClick
buttonClick
ObjName = "
Driver" & i
startPos =
(j*2-1)
ObjPath
objName, \
(j*2)
endPos =
(j*2+1)
(j*2+2)
moveImage
i = 1
U"driverLine" = 5685,3720,6555,3150
"ConMem" = 6720,3326,8085,5119
Organize Memory
reset
,&H.&
6ObjPath
ConMem
driverLine
rectangle Driver
ObjName
buttonClick
buttonClick
ObjName = "
Driver" & i
Pos=ObjPath
"ConMem" = 6720,3326,8085,4408
U"driverLine" = 5700,4170,6540,4560
Reset Memory
Conventional
Memory
Upper
Memory
Blocks
(umb)
Extended
Memory
Enter & Leave
Handlers: Enter & Leave
title
2550,-337
Postit4
415,-2307
Postit2
5300,-2237
Postit3
1440,6090
Postit1
Keep enter and leave handlers as simple as possible. Every command in an enter handler will increase the time required to enter the object (page, background, field, and so on). Every command in a leave handler will increase the time required to leave the object.
Do not send system messages, such as Previous, Next, and Back, in enter or leave handlers. These messages can cause serious errors if ToolBook is not allowed to get back to top level. The most common message displayed when this happens is "Handlers Nested Too Deep."
Enter & Leave Handlers should be kept simple
OpenScript Handlers
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
Handlers: Idle
title
2550,-481
Postit4
415,-2451
Postit2
5300,-2381
Postit3
1440,5940
Postit1
Keep idle handlers simple. The more complex the handler, the longer it will take to execute before allowing ToolBook to return to top level. This will make the program appear slow to the user. Keep the handlers short and simple so that if a user clicks a button, there will seem to be an immediate response.e.. seem to be an immediate response.%
Idle Handlers Handlers
Generic Scripts
Handlers: Generic Scripts
title
2550,527
Postit4
415,-1443
Postit2
5300,-1373
Postit3
1440,6990
Postit1
The most common use of a generic script is for a group of buttons. Creating a script for a group buttons that perform the same function, and placing that script in the group, eliminates the need to store code for each button and provides one location to find the script.
By using a generic script for many objects instead of the same script in each object not only makes it easier to change the code, and saves page/background memory.
Each page or background has a limited amount of memory for objects, user-defined properties, and scripts. By having a generic script instead of individual scripts, less memory has to be allocated for the page/background..d.nd.ground.
Generic Scriptsandlers
Execute ( )
s_lastTestTime
s_testTime
testType
enterPage
4s_testTime, s_lastTestTime
"testType"
OpenScript: Execute ( )
title
5300,-221
Postit4
1440,8190
Postit2
2550,1535
Postit3
2550,1679
Postit1
Sometimes you may need to have a script build an OpenScript command in the form of a text string, then execute it. To do this you can use the execute command.
The execute command runs more slowly than executing the same statements in a script, because ToolBook must compile the script before it can run it. The execute command is useful in cases where you can't otherwise specify a statement.
If you use the execute command in a script, use it sparingly to minimize the additional time necessary for it to run. The adjacent example demonstrates the extra time it takes to use the execute command to run a script.d to run a script.n a script.
Execute Commandd
testType
buttonDown
s_testType
buttonUp
4s_testType
Execute
Properties
Script
Test Type
.&+ +E
,%H.%
,%H.%
.&+ +E
foo of self = 0;step j from 1 to
Script
showElapsedTime
s_testType
s_testObj
s_testType
startTime
;foo of self = foo of self + j;end
Execute
buttonClick
buttonClick
4s_testType, s_testObj
"Execute"
startTime
cmd = "foo
"& i &";
"Script"
showElapsedTime
415,-291
OpenScript Commands
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
4!F!{
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
EnterPage
leavePage
UpdateDisplay
updateDisplay
enterPage
SysHistoryRecord
OpenScript: SysHistoryRecord
title
2550,4415
Postit4
2550,4559
Postit2
2550,4703
Postit3
415,2733
Postit1
sysHistoryRecord is a system property that specifies whether ToolBook adds pages to the history stack in sysHistory. You can get or set this property.
When sysHistoryRecord is set to false, any pages that are displayed in the Main window are not added to the history of the book. You can use this property to create a custom history that ToolBook can't modify.
When sysHistoryRecord is true (default value), the uniqueName of a page is put onto a list called sysHistory.
If sysHistoryRecord is set to false then up to 4K of system memory can be saved because sysHistory can contain up to the last 100 pages where the user has gone.
Any time you can reduce unnecessary actions or commands from being executed you can improve speed and performance. Setting sysHistoryRecord to false speeds up animated sequences that involve flipping pages because the uniqueName of the page is not put on a system variable list.
If you set sysHistoryRecord to false, you may also want to remove the Back command from the Page menu. Because the Back command always goes to the last page added to the history, a user may find that choosing Back does not always return to the previous page accessed by a script.ript.t.
sysHistoryRecordd
5300,2803
1440,11340
2550,4559
Postit4
415,2589
Postit2
5300,2659
Postit3
1440,11190
Postit1
User Properties and Variables
title
For maximum speed use user properties sparingly, because it takes time for ToolBook to locate the user property and access its contents. User properties are most useful in enterApplication and enterBook handlers because these handlers are run once per instance of the book.
Starting in ToolBook 3.0, applications can access up to 16 MB of RAM, which makes the overuse of system variables much easier. System variables do not affect speed until they get very large, or until the available RAM gets low. As available RAM gets low, the system will become sluggish because Windows has to swap memory out to disk.
Also starting in ToolBook 3.0 variables can be typed, which can make handlers run faster and use less memory because the data is already in the internal (binary) form that ToolBook requires. A typed variable is also in its most efficient format. Assigning a data type to a variable helps prevent errors because you cannot assign inappropriate data to the variable.
The example at the right adds the numbers from 1 to 2000 in the type of variable that is selected. The script does this by stepping through the numbers and adding them to the previous sum.
For more information about Variables, Values, Arrays, Lists, and Text see Chapter 6, in the User Manual "Variables, values, and text."and text..t.
User Properties and Variables
testType
buttonDown
s_testType
buttonUp
4s_testType
User Property
Properties
System Variable
Properties
Local Variable
Test Type
.&+ +E
,%H.%
,%H.%
,%H.%
.&+ +E
Local Variable
showElapsedTime
s_testType
System Variable
startTime
User Property
buttonClick
buttonClick
4s_testType, s_testObj
"Local Variable"
startTime
0 + i
"System
4foo2
* + i
"User Property"
bar
showElapsedTime
User Properties and Variables
s_lastTestTime
s_testTime
testType
enterPage
4s_testTime, s_lastTestTime
"testType"
Postit4
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit4
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit4"
720,105
offset
Postit4
3postit4
3Postit4
EnterPage
3Postit4
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit4
= Postit4
textUnderFlow
Forward
Postit2
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit2
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit2"
935,110
offset
Postit2
2postit2
2Postit2
EnterPage
2Postit2
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit2
= Postit2
textUnderFlow
Postit3
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit3
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit3"
745,40
offset
Postit3
%3Postit3
%3postit3
EnterPage
&3Postit3
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit3
= Postit3
textUnderFlow
Postit1
keyUp
enterRecordField
>= ""
VFalse
offset
ButtonStillDown
offset
offset
buttonDown
Postit1
buttonclick
ButtonStillDown
oPosition
buttonclick
J"Postit1"
6%H%{
630,45
offset
Postit1
]2Postit1
]2postit1
EnterPage
^2Postit1
leavePage
keyUp
notifyBefore EnterPage
textOverFlow
postit1
= Postit1
textUnderFlow
notes
EnterPage
notes
UpdateDisplay
notifyAfter EnterPage
MainWindow
notes
enabled
notifyBefore UpdateDisplay
bottomLine
topLine
content text
lrgScroll
lrgscroll
enterPage
notifyBefore
textOverFlow
"lrgscroll"
"lrgScroll"
LRGSCROLL
scrollField
pageSize
sliderValue
maxScroll
Content Text
thumb
enterPage
notifyafter
4maxScroll,scrollField,pageSize
J"Content Text"
lockScreen
Z = 0
[ = 0
ctextOverFlow
sliderValue
B"thumb"
scrollField
PupdateDisplay
buttonDown
scrollField
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
M > 0
scrollField
maxScroll
PupdateDisplay
buttonDown
scrollField
maxScroll
PupdateDisplay
buttonStillDown
4maxScroll, scrollField
updateDisplay
Slider
pageUp
dpageDown
thumb
PupdateDisplay
buttonClick
buttonClick
B"thumb"
pageUp
pageDown
updateDisplay
Thumb
EnterPage
leavePage
UpdateDisplay
EnterPage
updateDisplay
TmpltTool
removeBookMark
i#gotoBookMark
ButtonClick
ButtonClick
gotoBookMark
Go to Book Mark
popHelpText
addBookMark
&eBookMark
buttonClick
1, "@
nomark
bookMarks
updateDisplay
buttonClick
BookMark
notifyAfter updateDisplay
bookMarks
onormalGraphic = icon "mark"
#on "nomark"
Add Book Mark
popHelpText
8notePad
buttonClick
buttonClick
notePad
Note Pad
popHelpText
tChangeTutorial
buttonClick
buttonClick
ChangeTutorial
Select Tutorial
popHelpText
heading
(postit
buttonClick
buttonClick
postit
Post Notes
pophelpText
Table of Contents
buttonClick
buttonClick
MainWindow
"Table
Contents"
Table of Contents
popHelpText
updateDisplay
User Properties and Variablesive
95050919534438586212124501368
ASYM_TpID
TutorialList
Rebuild
buttonClick
buttonClick
&Rebuild
bottomLine
Cancel
TutorialList
buttonClick
buttonClick
isOpen
"TutorialList"
close
&Cancel
Rebuild
tutorialList
&Cancel
&Rebuild
TutorialList
I can't find the tutorial book
File Not Found
buttonClick
buttonClick
4tutorialList[][]
selectedTextLines
"TutorialList"
8(path
][2])
c"File Not Found"
][2])
"I can't find the
f"&Cancel"
"&Rebuild"
isOpen
close
&Go To
ThreeDeeRect
out,sculpted
TutorialList
tempFileinfo
tutorialList
TutorialList
getInivar
tutorial.ini
enterpage
notifyBefore
4tutorialList[][]
counter
Ztempfile
tempFileinfo = getInivar("TutorialList",
D,path
h.ini")
ctempFileInfo <> ""
W) = 2
][1] =
][2] =
dimensions(
i][1] &CRLF
--Clear off the extra
topLine
enterpage
PopText
95050919593838940058139359890
ASYM_TpID
GrayBack
Notepad
Reset
Notes
Notepad
notes
buttonClick
buttonClick
MainWindow
"Notes"
"Notepad" = notes
&Reset
Notes
Cancel
Notepad
buttonClick
buttonClick
isOpen
"Notepad"
close
&Cancel
Notes
notes
Notepad
PupdateDisplay
buttonClick
buttonClick
MainWindow
notes
"Notes"
"Notepad"
updateDisplay
isOpen
close
&Save
ThreeDeeRect
out,sculpted
Notes
Notepad
notes
enterPage
keyChar
enterField
NotifyBefore
MainWindow
"Notes"
"Notepad" = notes
key,isShift,isCtrl
keyEnter
buttonClick
bottomLine
topLine
enterPage
Notepad
9505091959443894531416471984
ASYM_TpID
GrayBack
PopHelp
ASYM_BeenHere
ShowText
1,"JdY
updateDisplay
updateDisplay
= 1440/14 *
otextRightOverFlow > 2
Note Pad Contentsy of a page or background that indicates how much of the 64K boundary is available for content.